package com.asset.dispoal.business.mediation.service;

import com.asset.dispoal.business.mediation.api.CollectionRecordService;
import com.asset.dispoal.business.mediation.dto.CollectionRecordResponse;
import com.asset.dispoal.business.mediation.dto.QueryCollectionRecordRequest;
import com.asset.dispoal.business.mediation.dto.SaveCollectionRecordRequest;
import com.asset.dispoal.business.mediation.service.common.QueryColletionCommand;
import com.asset.dispoal.business.mediation.service.common.SaveColletionCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

/**
 * @description:
 * @author: yf
 * @date: 2022-09-13
 */
@Service
public class CollectionRecordImpl implements CollectionRecordService {

    @Autowired
    private SaveColletionCommand saveColletionCommand;
    @Autowired
    private QueryColletionCommand queryColletionCommand;

    @Override
    public Result save(SaveCollectionRecordRequest request) {
        return saveColletionCommand.execute(request);
    }

    @Override
    public Result<PageVO<CollectionRecordResponse>> query(QueryCollectionRecordRequest request) {
        return queryColletionCommand.execute(request);
    }
}
